package experiment_6;

import java.util.Scanner;

public class Test {
	public static void main(String[] args) throws Exception {
		Scanner input = new Scanner(System.in);
		Student student;
		Teacher teacher;
		Subject subject = new Subject();
		experiment_6.system.main(args);
		boolean f = true;
		while (f) { // 判断输入是否正确
			int ch = input.nextInt();
			if (ch == 1) {
				// teacher
				subject.Output_Curriculum();

				subject.Start_class(); // 开课
				subject.Output_Curr_Start(); // 输出开课课表
				teacher = new Teacher("teacher", 39, 1861171, "男", "清华");
				System.out.println("姓名：" + teacher.getName() + "   " +
						"年龄：" + teacher.getAge() + "   " +
						"编号：" + teacher.getBianhao() + "   " +
						"性别：" + teacher.getXingbie() + "   " +
						"毕业院校:" + teacher.getSchool());
				// 学生
				System.out.println();
				subject.Course_selection(); // 选课

				subject.Output_Curr_Course();
				student = new Student("江一宁", 19, 2020310842, "男", "北京市丰台区");
				String n = "姓名：" + student.getName() + "   "
						+ "年龄：" + student.getAge() + "   "
						+ "编号：" + student.getBianhao() + "   "
						+ "性别：" + student.getXingbie() + "   "
						+ "家乡:" + student.getHome();

				System.out.println(n);
				System.out.println("请输入文件名称：");
				String dizhi = input.next();

				IO_document.xieRu(n + "\n" + IO_document.zhuanHuan(Subject.su2), dizhi);

				IO_document.duQu("E:\\FirstJava\\src\\experiment_6\\" + dizhi + ".txt");
				System.out.println();
				subject.Delete_class(); // 退课
				subject.getDelete_class();// 输出退课课表
				IO_document.xieRu(n + "\n" + IO_document.zhuanHuan(Subject.su3), dizhi);
				f = false;
				break;
			}
			if (ch == 0) {
				System.out.println("已退出");
				System.exit(0);
				f = false;
				break;
			} else {
				System.out.println("输入错误！请重新输入");
			}
		}
	}
}
